package src.main.java.org.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

/*
* 文件复制
* */
public class Test3 {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("E:\\ab.txt");
        FileOutputStream fos = new FileOutputStream("D:\\ab.txt");

        byte[] buffer = new byte[1024];//创建一个字符数组，负责转移数据
        int len;
        while((len= fis.read(buffer))!=-1){
            fos.write(buffer,0,len);
        }

        fos.close();
        fis.close();

    }
}
